Computer programs may be written to allow different portions (e.g., threads) of the program to be executed concurrently. One of the difficulties in writing correct multi-threaded programs is the possibility of race conditions. Race conditions are concurrent accesses to the same memory location by more then one thread where at least one of the accesses is a write. Race conditions are caused when programs fail to properly synchronize accesses using some locking discipline and may lead to highly non-deterministic behavior. The behavior is usually a bug and may be a bug that is particularly difficult to diagnose using traditional debugging techniques.
Static race detection techniques typically involving having the programmer add annotations to the program that express the locking discipline. Adherence to the locking discipline is then statically checked. The extra annotations, however, may be extensive and place additional work in the programmer to learn a new, or at least significantly extended, language. In addition, the annotations may not support all desired synchronization idioms. Dynamic race detection techniques may not be sound or complete. Dynamic race detection techniques may both give false positives and fail to detect all races.